<?php

namespace app\student\controller;
use app\student\security\StuCheck as StuCheckLogic;
use think\Controller;

class Index extends Controller
{
    /**
     * 登录界面显示，自动登录
     * @access public
     * @return mixed 返回登录视图
     */
    public function index(){
        //检测教师token
        $stuCheck=new StuCheckLogic();
        if($stuCheck->check()==1){
            //成功跳转到主页
            //读取服务器配置
            $this->assign('config',getSrvConfig());
            return $this->fetch('index/index');
        }else{
            //失败跳转到登陆界面
            return $this->fetch('login/login');
        }
    }
}